package com.study.cloud.gateway.core.filter.loadBalance;

import com.study.cloud.gateway.common.rule.ServiceInstance;
import com.study.cloud.gateway.core.context.GatewayContext;

/**
 *
 * 负载均衡顶级接口
 * @author wangwancheng
 * @create 2025/7/20 17:11
 */
public interface IGatewayLoadBalanceRule {
    /**
     * 通过上下文 获取服务实例
     * @param gatewayContext
     * @return
     */
    ServiceInstance choose(GatewayContext gatewayContext);

    /**
     * 通过服务id 获取服务实例
     * @param serviceId
     * @return
     */
    ServiceInstance choose(String uniqueId);
}
